package main

func dailyTemperatures(temperatures []int) []int {

	for i := 0; i < len(temperatures); i++ {
		j := i + 1
		for j = i + 1; j < len(temperatures); j++ {
			if temperatures[j] > temperatures[i] {
				break
			}
		}

		if j != len(temperatures) {
			temperatures[i] = j - i
		} else {
			temperatures[i] = 0
		}
	}

	return temperatures
}
